package com.yunpi.integration.common.constants;

public class CommonConstants {

    public final static String CONTEXT_TOKEN = "Authorization";
    public final static String SECRETKEY = "secretKey";
    public final static String CONTEXT_USERNAME = "contextUsername";
    public final static String CONTEXT_USER_ID = "contextUserId";
    public final static String CONTEXT_NAME = "contextName";
    public final static String CONTEXT_TENANTID = "contextTenantId";
    public final static String CONTEXT_USER_GROUP = "contextUserGroup";
    public final static String CONTEXT_DEPART_NAME = "contextDepartName";
    public final static String CONTEXT_DEPART_ID = "contextDepartId";
    public final static String JWT_PRIVATE_KEY = "wwwbootdocom";
    public final static String RENEWAL_TIME = "renewalTime";

    public final static String INVALID_TIME_MARKING = "invalidTimeMarking";
    public final static Long INVALID_TIME = Long.valueOf(600);

    public final static String TOKEN_KEY = "token";
    public final static String PERMS_KEYT = "perms";
    public static final String ROUTER_KEY = "router";
    public static final String USER_KEY = "user";
    public static final String REDIS_KEY_DICT = "redisKeyDict";
    public static final String DICT_KEYVALUE = "keyValue";
    public static final String DICT_VALUEKEY = "valueKey";

    public static final String INTERFACES_ALL = "interfacesAll";


    public final static int CODE_GET_200 = 200;//[GET]：服务器成功返回用户请求的数据，该操作是幂等的（Idempotent）

    public final static int CODE_POST_201 = 201;//新建或修改操作成功

    public final static int CODE_ACCEPTED_202 = 202;//任务接收成功

    public final static int CODE_DELETE_204 = 204;//删除数据成功

    public final static int CODE_POST_400 = 400;//新建或修改操作失败

    public final static int CODE_UNAUTHORIZED_401 = 401;//未授权

    public final static int CODE_INVALID_TOKEN_402 = 402;//无效的token

    public final static int CODE_FORBIDDEN_403 = 403;//得到授权，访问被禁止

    public final static int CODE_NOT_FOUND_404 = 404;//没有服务响应

    public final static int CODE_NOT_SUPPORTED_405 = 405;//请求方法不支持

    public final static int CODE_NOT_ACCEPTABLE_406 = 406;//用户请求的格式不可得


    public final static int CODE_GONE_410 = 410;//请求资源被删除

    public final static int CODE_USER_IS_LOGIN = 415;

    public final static int CODE_UNPROCESABLE_422 = 422;//当创建一个对象时，发生一个验证错误

    public final static int CODE_SERVER_ERROR_500 = 500;//服务器发生错误,无法判断发出的请求是否成功


    /**
     * 是否，常量值
     */
    public final static int IS_YES = 1;
    public final static int IS_NO = 0;


    //无需安全验证的接口前缀
    public final static String API_PUB_PREFIX = "api-pub/";


    //超级管理员
    public final static String USER_SUPER_ADMIN = "1";
    //租户管理员
    public final static String USER_TENANT_ADMIN = "2";
    //普通用户
    public final static String USER_ORDINARY = "3";

    //内部用户
    public final static String USER_GROUP_INSIDE = "1";
    //平台用户
    public final static String USER_GROUP_PLATFORM = "2";

    //数据库类型
    public final static int DB_TYPE_MYSQL = 1;
    public final static int DB_TYPE_ORACLE = 2;
    public final static int DB_TYPE_SQLSERVER = 3;
    public final static int DB_TYPE_DB2 = 4;
    public final static int DB_TYPE_HBASE = 5;

    public final static String DEPART_TYPE_AREA = "0";
    //部门类型-部门
    public final static String DEPART_TYPE_DEPART = "1";
    //部门类型-科室
    public final static String DEPART_TYPE_OFFICE = "2";

    //租户管理员角色id，系统预设
    public final static String TENANT_ROLE_ID = "2";


    //权限类型
    public final static String PERMS_TYPE_SYS = "0";
    public final static String PERMS_TYPE_MUENU = "1";
    public final static String PERMS_TYPE_BUTTON = "2";

    //运行状态
    //运行中
    public final static String STATE_FRONTENDMACHINE_RUNNING = "3100";
    //已停止
    public final static String STATE_FRONTENDMACHINE_STOPING = "3101";
    //网络中断
    public final static String STATE_FRONTENDMACHINE_INTERRUPTION = "3102";


    /**
     * 文件导入进度标识
     */
    public interface IMPORTSTATE {
        /**
         * 正在导入
         */
        public static final String IMPORT_ING = "正在导入";
        /**
         * 导入完成
         */
        public static final String IMPORT_FINISH = "导入完成";
        /**
         * 导入异常
         */
        public static final String IMPORT_EXP = "异常终止";

    }

    /**
     * 文件操作标识
     */
    public interface FILEOPT {
        /**
         * 上传
         */
        public static final String UPLOAD = "upload";
        /**
         * 预览
         */
        public static final String PREVIEW = "preview";
        /**
         * 下载
         */
        public static final String DOWNLOAD = "download";

        /**
         * 导入
         */
        public static final String IMPORT = "import";
    }

    /**
     * 导入方式
     */
    public interface IMPORTTYPE {
        /**
         * 追加导入
         */
        public static final String APPEND = "append";
        /**
         * 覆盖导入
         */
        public static final String OVERWRITE = "overwrite";
    }


    /**
     * 文件类型标识
     */
    public interface FILETYPE {
        public static final String EXCEL = "excel";
        public static final String XLSX = "xlsx";
        public static final String XLS = "xls";

        public static final String CSV = "csv";
        public static final String TXT = "txt";
        public static final String JSON = "json";
        public static final String XML = "xml";
        public static final String SQL = "sql";

    }

    /**
     * 数据库类型
     */
    public interface DBTYPE {
        public static final String ORACLE = "oracle";
        public static final String DAMENG = "dameng";
        public static final String MYSQL = "mysql";
        public static final String SQLSERVER = "sqlserver";
        public static final String DB2 = "db2";

    }

    public interface INTYPE {
        public static final String PLATFORM = "PLATFORM";
        public static final String API = "API";
    }


    /**
     * 认证 body head 所属请求或响应 类型
     */
    public interface RESTFUL_AUTH_REQ_RESP_TYPE {
        public static final String AUTH_REQ = "request";
        public static final String AUTH_RESP = "response";
    }

    public interface RESTFUL_AUTH_PARAM_TYPE {
        public static final String TYPE_PARAM = "param";
        public static final String TYPE_BODY = "body";
        public static final String TYPE_HEAD = "head";
    }

    /**
     * 认证类型
     */
    public interface RESTFUL_AUTH_TYPE {
        public static final String AUTH_TYPE_PARAM = "param"; // 固定参数认证
        public static final String AUTH_TYPE_FORM = "form";  // session - cookie
        public static final String AUTH_TYPE_JWT = "jwt";  // 登陆接口获取token
        public static final String AUTH_TYPE_HTTPBASIC = "basic"; // http基础认证
        public static final String AUTH_TYPE_HTTPDIGEST = "digest"; // 摘要认证
    }

    /**
     * 认证请求类型
     */
    public interface RESTFUL_REQUEST_TYPE {
        public static final String AUTH = "auth"; // 系统接口使用的认证信息
        public static final String LOGIN = "login"; // 登陆请求
        public static final String LOGINAUTH = "loginAuth"; // 登陆认证关联请求
    }

    /**
     * 认证响应类型
     */
    public interface RESTFUL_RESPONSE_TYPE {
        public static final String SUCCESS = "success";
        public static final String FAILED = "failed";
        public static final String INVALID = "invalid";
    }

    public interface RESOURCE_LEGAL_LABEL {
        public static final String CERTIFICATE_FOR_UNIFORM_SOCIAL_CREDIT_CODE = "CFUSCC"; //统一社会信用代码
        public static final String BUSINESS_LICENSE_REGISTRATION_NUMBER = "BLRN";//营业执照注册号
        public static final String DUTY_PARAGRAPH = "DP";//税号
        public static final String ORGANIZATIONAL_CODE = "OC";//组织机构代码
        public static final String TAX_REGISTRATION_CERTIFICATE = "TRC";//税务登记证
        public static final String STATISTICAL_REGISTRATION_CERTIFICATE = "SRC";//统计登记证
        public static final String SOCIAL_INSURANCE_REGISTRATION_CERTIFICATE = "SIRC";//社会保险登记证
        public static final String ORGANIZATIONAL_NAME = "ON";//机构名称
    }

    public interface RESOURCE_POPULATION_LABEl{
        public static final String POPULATION_NAME="PN"; // 姓名
        public static final String IDENTITY_CARD ="IC"; // 身份证
    }

    /**
     *  核心库数据任务匹配
     */
    public final static String REGEX_CORE_DATA = "coredata";

}
